home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / AdobeExamples / NX_Text / hdshowany.h < prev    next >
Encoding:
Text File  |  1992-12-19  |  4.6 KB  |  119 lines

  1.  
  2. /*
  3.  * (a)  (C) 1990 by Adobe Systems Incorporated. All rights reserved.
  4.  *
  5.  * (b)  If this Sample Code is distributed as part of the Display PostScript
  6.  *    System Software Development Kit from Adobe Systems Incorporated,
  7.  *    then this copy is designated as Development Software and its use is
  8.  *    subject to the terms of the License Agreement attached to such Kit.
  9.  *
  10.  * (c)  If this Sample Code is distributed independently, then the following
  11.  *    terms apply:
  12.  *
  13.  * (d)  This file may be freely copied and redistributed as long as:
  14.  *    1) Parts (a), (d), (e) and (f) continue to be included in the file,
  15.  *    2) If the file has been modified in any way, a notice of such
  16.  *      modification is conspicuously indicated.
  17.  *
  18.  * (e)  PostScript, Display PostScript, and Adobe are registered trademarks of
  19.  *    Adobe Systems Incorporated.
  20.  * 
  21.  * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
  22.  *    CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
  23.  *    AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
  24.  *    ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
  25.  *    OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
  26.  *    WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
  27.  *    WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
  28.  *    DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, 
  29.  *    FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
  30.  *    OF THIRD PARTY RIGHTS.
  31.  */
  32.  
  33. /*
  34.    filename    : hdshowany.h
  35.    date created    : 15-feb-90
  36.    last updated    : 23-oct-90
  37.    author        : ross a jeynes
  38.    porter        : ken r fromm
  39.    purpose    : structure definitions, defines, global variables for the high level
  40.                   driver routines
  41. */
  42.  
  43. /*
  44. *    The following are "attributes," or "events," that can happen at a certain character
  45. *    on the line of text.  The field "attr" in the showstruct structure is an array of
  46. *    these attributes, whoose indexes correspond to the "text" field.
  47. */
  48.  
  49. #import <appkit/graphics.h>
  50.  
  51. /* showany attributes: */
  52. #define SA_NOATTR            0            /* no attribute for this character */
  53.                                         /* attributes on */
  54. #define SA_UNDRLN_ON        1            /* underline */
  55. #define SA_DBLUND_ON        2            /* double underline */
  56. #define SA_STRIKE_ON        4            /* strike-through */
  57. #define SA_SUPER_ON        8
  58. #define SA_SUB_ON            16
  59.  
  60. #define SA_UNDRLN_OFF        32            /* attributes off */
  61. #define SA_DBLUND_OFF        64
  62. #define SA_STRIKE_OFF        128
  63. #define SA_SUPER_OFF        256
  64. #define SA_SUB_OFF            512
  65.  
  66. #define SA_PRKERN            1024        /* Pair kern */
  67. #define SA_VKERN            2048
  68. #define SA_ABSMOV            4096
  69.  
  70. #define SA_FONTCHG            8192        /* Font change */
  71. #define SA_SPACEADJ        16384        /* Space adjustment value change */
  72. #define SA_TRACKADJ        32768        /* Track kern value change */
  73.  
  74. #define SA_TXON_ATTRS (SA_UNDRLN_ON|SA_STRIKE_ON|SA_DBLUND_ON)
  75. #define SA_TXOFF_ATTRS (SA_UNDRLN_OFF|SA_STRIKE_OFF|SA_DBLUND_OFF)
  76. #define SA_NOTTX_ATTRS (SA_PRKERN|SA_FONTCHG|SA_SPACEADJ|SA_TRACKADJ)
  77.  
  78.  
  79. /* def's for "encoding" array in showstruct */
  80. #define SA_DEFAULT            0    /* don't re-encode (font specific vector) */
  81. #define SA_EXTENDED        1    /* use application text encoding */
  82.  
  83. typedef struct showstruct
  84. {
  85.     char        *text;        /* The characters to be shown (null terminated) */
  86. unsigned int    *attr;            /* an array equal in length to *text that describes attribute(s) */
  87.  
  88.     NXCoord        *prkern;        /* amount of pair kern (array) */
  89.     NXCoord        *vkern;        /* amount of vertical kern (array) */
  90.     NXPoint        *absmov;        /* coordinates for absolute movetos */
  91.     NXCoord        *spaceadj;    /* amount to adjust space character */
  92.     NXCoord        *trackkern;    /* track kern adjustment amount */
  93.  
  94.     int    textlen;            /* actual number of characters in text and attr */
  95.     int    prkernlen;        /* actual number of entries filled in prkern array */
  96.     int    vkernlen;            /* actual number of entries in vkern array (used for super/sub) */
  97.     int    absmovlen;        /* actual number of absolute movetos / 2 coords*/
  98.     int     spaceadjlen;        /* actual number of entries filled in space changes array */
  99.     int     trackkernlen;        /* actual number of entries filled in track kerns array */
  100.  
  101.     /*
  102.     *    These values are unimportant to showany(), but are used in the
  103.     *    building of the structure by the routines in buildshow.c.  They allow
  104.     *    dynamic re-sizing of the arrays, but may be removed if the buildshow
  105.     *    routines are not used to create the showstruct data structure
  106.     */
  107.  
  108.     int    textmax;            /* max length of the text string; length of "attr" as well */
  109.     int    prkernmax;        /* max length allocated for prkern array */
  110.     int    vkernmax;        /* max length allocated for vkern array */
  111.     int    absmovmax;        /* max length allocated for absmov array */
  112.     int     spaceadjmax;        /* max length allocated for space changes array */
  113.     int     trackkernmax;        /* max length allocated for track kerns array */
  114. } ShowStruct;
  115.  
  116.  
  117. /*******  Prototypes for High Level Driver  ******/
  118. void        ShowAny(ShowStruct *show);
  119.